import request from "@/utils/request";

// 创建楼栋
export function createBuilding(data) {
  return request({
    url: "/building/v1/create",
    method: "post",
    data: data,
  });
}

// 获取楼栋
export function getBuilding(params) {
  return request({
    url: "/building/v1/list",
    method: "get",
    params: params,
  });
}

// 更新楼栋
export function updateBuilding(id, data) {
  return request({
    url: "/building/v1/update",
    method: "put",
    data: data,
  });
}

// 删除楼栋
export function deleteBuilding(id) {
  return request({
    url: "/building/v1/delete/" + id,
    method: "delete",
  });
}

// 获取楼栋详情
export function getBuildingDetail(id) {
  return request({
    url: "/building/v1/detail/" + id,
    method: "get",
  });
}

// 绑定电梯
export function buildingElevator(data) {
  return request({
    url: "/building/v1/binding",
    method: "post",
    data: data,
  });
}
